using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//自动生成于：2020/11/12 10:00:24
namespace StarForce
{

	public partial class LoopListPage : UGuiForm
	{

		private LoopCollection<ItemDemo> m_LoopListH;
		private LoopCollection<ItemDemo> m_LoopListV;
		
		private LoopCollection<ItemDemo> m_LoopListH2;
		private LoopCollection<ItemDemo> m_LoopListV2;
		protected override void OnInit(object userdata)
		{
			base.OnInit(userdata);

			GetBindComponents(gameObject);
			
			m_LoopListH = new LoopCollection<ItemDemo>(m_SRect_H.gameObject,CallBackH);
			m_LoopListV = new LoopCollection<ItemDemo>(m_SRect_V.gameObject,CallBackV);
			
			m_LoopListH2 = new LoopCollection<ItemDemo>(m_SRect_H2.gameObject,CallBackH2);
			m_LoopListV2 = new LoopCollection<ItemDemo>(m_SRect_V2.gameObject,CallBackV2);
			
			m_Btn_Close.onClick.AddListener(Close);
		}

		protected override void OnOpen(object userData)
		{
			base.OnOpen(userData);
			m_LoopListH.ShowList(30);
			m_LoopListV.ShowList(30);		
			m_LoopListH2.ShowList(50);
			m_LoopListV2.ShowList(50);
		}

		private void CallBackV(GameObject arg1, int arg2)
		{
			ItemDemo data = m_LoopListV.GetOrAddItem(arg1, arg2);

			data.Num.text = arg2.ToString();
		}

		private void CallBackH(GameObject arg1, int arg2)
		{
			ItemDemo data = m_LoopListH.GetOrAddItem(arg1, arg2);

			data.Num.text = arg2.ToString();
		}
		
		
		private void CallBackV2(GameObject arg1, int arg2)
		{
			ItemDemo data = m_LoopListV.GetOrAddItem(arg1, arg2);

			data.Num.text = arg2.ToString();
		}

		private void CallBackH2(GameObject arg1, int arg2)
		{
			ItemDemo data = m_LoopListH.GetOrAddItem(arg1, arg2);

			data.Num.text = arg2.ToString();
		}
	}
}
